3.313 \(\int (a+b \sec ^2(e+f x)) \tan (e+f x) \, dx\)

Optimal. Leaf size=30 \[ \frac {b \sec ^2(e+f x)}{2 f}-\frac {a \log (\cos (e+f x))}{f} \]

[Out]

-a*ln(cos(f*x+e))/f+1/2*b*sec(f*x+e)^2/f

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4138, 14} \[ \frac {b \sec ^2(e+f x)}{2 f}-\frac {a \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)*Tan[e + f*x],x]

[Out]

-((a*Log[Cos[e + f*x]])/f) + (b*Sec[e + f*x]^2)/(2*f)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \sec ^2(e+f x)\right ) \tan (e+f x) \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {b+a x^2}{x^3} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {b}{x^3}+\frac {a}{x}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {a \log (\cos (e+f x))}{f}+\frac {b \sec ^2(e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 30, normalized size = 1.00 \[ \frac {b \sec ^2(e+f x)}{2 f}-\frac {a \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)*Tan[e + f*x],x]

[Out]

-((a*Log[Cos[e + f*x]])/f) + (b*Sec[e + f*x]^2)/(2*f)

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 37, normalized size = 1.23 \[ -\frac {2 \, a \cos \left (f x + e\right )^{2} \log \left (-\cos \left (f x + e\right )\right ) - b}{2 \, f \cos \left (f x + e\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e),x, algorithm="fricas")

[Out]

-1/2*(2*a*cos(f*x + e)^2*log(-cos(f*x + e)) - b)/(f*cos(f*x + e)^2)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(a/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-c
os(f*x+exp(1)))*(1+cos(f*x+exp(1)))+2))-a/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)
))*(1+cos(f*x+exp(1)))-2))+(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))
)*a-2*a+4*b)*1/4/((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))-2))

________________________________________________________________________________________

maple [A]  time = 0.23, size = 28, normalized size = 0.93 \[ \frac {b \left (\sec ^{2}\left (f x +e \right )\right )}{2 f}+\frac {a \ln \left (\sec \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)*tan(f*x+e),x)

[Out]

1/2*b*sec(f*x+e)^2/f+1/f*a*ln(sec(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 33, normalized size = 1.10 \[ -\frac {a \log \left (\sin \left (f x + e\right )^{2} - 1\right ) + \frac {b}{\sin \left (f x + e\right )^{2} - 1}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e),x, algorithm="maxima")

[Out]

-1/2*(a*log(sin(f*x + e)^2 - 1) + b/(sin(f*x + e)^2 - 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.93, size = 32, normalized size = 1.07 \[ \frac {a\,\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f}+\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)*(a + b/cos(e + f*x)^2),x)

[Out]

(a*log(tan(e + f*x)^2 + 1))/(2*f) + (b*tan(e + f*x)^2)/(2*f)

________________________________________________________________________________________

sympy [A]  time = 0.46, size = 42, normalized size = 1.40 \[ \begin {cases} \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b \sec ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\relax (e )}\right ) \tan {\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)*tan(f*x+e),x)

[Out]

Piecewise((a*log(tan(e + f*x)**2 + 1)/(2*f) + b*sec(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b*sec(e)**2)*tan(e),
 True))

________________________________________________________________________________________